package com.mathcat.mobile.android.data.account;

class AccountImpl implements Account {

	String uid;
	
	String password;
	
	boolean isPasswordRemembered;
	
	boolean isAutoLogin;
	
	boolean isLastLogin;
	
	AccountImpl(String uid, String password, boolean isPasswordRemembered, boolean isAutoLogin, boolean isLastLogin) {
		if (uid == null)
			throw new NullPointerException("User ID must not be null!");
		if (password == null)
			throw new NullPointerException("Password must not be null!");
		
		this.uid = uid;
		this.password = password;
		this.isPasswordRemembered = isPasswordRemembered;
		this.isAutoLogin = isAutoLogin;
		this.isLastLogin = isLastLogin;
	}
	
	public String getUid() {
		return uid;
	}
	
	public String getPassword() {
		return password;
	}
	
	public boolean isPasswordRemembered() {
		return isPasswordRemembered;
	}
	
	public boolean isAutoLogin() {
		return isAutoLogin;
	}
	
	public boolean isLastLogin() {
		return isLastLogin;
	}
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("uid = " + uid 
				+ ", password = " + password
				+ ", isPasswordRemembered = " + isPasswordRemembered 
				+ ", isAutoLogin = " + isAutoLogin
				+ ", isLastLogin = " + isLastLogin);
		return sb.toString();
	}
}
